using System.Collections.Generic;
using NHibernate;
using NHibernate.Criterion;

namespace LuceneSearch.ContactApp.Repositories
{
    public class Repository<T> where T : class
    {
        public IEnumerable<T> FindByIds(ISession session, int[] ids)
        {
            return session.CreateCriteria(typeof (T))
                .Add(Restrictions.In("Id", ids))
                .List<T>();
        }
    }
}